package cn.tedu._03vehicle.base.config;

import cn.tedu._03vehicle.base.ceptors.InterCeptor;
import cn.tedu._03vehicle.base.ceptors.LoginCeptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class CeptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new InterCeptor()).addPathPatterns("/v1/user/**");
//        registry.addInterceptor(new InterCeptor()).excludePathPatterns("/v1/user/Login");
        registry.addInterceptor(new LoginCeptor()).addPathPatterns("v1/vehicle/**");
    }
}
